{{csrf_field()}}
<div class="layui-row">
    <div class="layui-col-md9 layui-col-lg10">
        <div class="layui-form-item">
            <label for="" class="layui-form-label">栏目名称：</label>
            <div class="layui-input-inline">
                <input type="text" name="name" value="{{ $dao->name ?? old('name') }}" lay-verify="required" placeholder="请输入栏目名称" class="layui-input" >
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">所属栏目</label>
            <div class="layui-input-inline">
                <select name="parent_id"  id="parent_id">
                    <option value="0">顶级栏目</option>
                    @foreach($tree as $key=>$val)
                        @if (isset($dao) && $dao->parent_id == $val['id'])
                            <option value="{{$val['id']}}" selected >{!! str_repeat('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;', intval($val['lv'])) !!} {{$val['name']}}</option>
                        @else
                            <option value="{{$val['id']}}" >{!! str_repeat('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;', intval($val['lv'])) !!}{{$val['name']}}</option>
                        @endif
                    @endforeach
                </select>
            </div>
            <div class="layui-form-mid layui-word-aux">请选择栏目</div>
        </div>
        <div class="layui-form-item">
            <label for="" class="layui-form-label">模版：</label>
            <div class="layui-input-block">
                @foreach(\Illuminate\Support\Facades\Config::get('constant.mode') as $key => $item)
                    @if(isset($dao->mode) &&$dao->mode == $key)
                        <input type="radio" name="mode" value="{{$key}}" title="{{$item}}" checked>
                    @else
                        <input type="radio" name="mode" value="{{$key}}" title="{{$item}}">
                    @endif
                @endforeach
            </div>
        </div>
        <div class="layui-form-item">
            <label for="" class="layui-form-label">URL链接：</label>
            <div class="layui-input-inline">
                <input type="text" name="url" value="{{$dao->url??old('url')}}"  placeholder="请输入URL外链" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label for="" class="layui-form-label">排序：</label>
            <div class="layui-input-inline">
                <input type="text" name="sort" value="{{$dao->sort ?? 99}}"  placeholder="" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label for="" class="layui-form-label">SEO标题：</label>
            <div class="layui-input-block">
                <input type="text" name="title" value="{{$dao->title??old('title')}}"   placeholder="请输入SEO标题" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label for="" class="layui-form-label">关键词：</label>
            <div class="layui-input-block">
                <input type="text" name="keyword" value="{{$dao->keyword??old('keyword')}}"   placeholder="请输入SEO关键字" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label for="" class="layui-form-label">SEO描述：</label>
            <div class="layui-input-block">
                <input type="text" name="description" value="{{$dao->description??old('description')}}"   placeholder="请输入SEO描述" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label for="" class="layui-form-label">内容：</label>
            <div class="layui-input-block">
                @component('admin.kindeditor',['name'=>'content','content'=>$dao->content??""])
                @endcomponent
            </div>
        </div>
    </div>
    <div class="layui-col-md3 layui-col-lg2">
        <div class="layui-form-item">
            <div class="layui-input-block">
                <div class="layui-upload-drag" id="test1" onmousemove="tips()" style="padding:15px; height: 150px">
                    @if(isset($dao->picture))
                        <img class="layui-upload-img" style="width: 100%;height: 100%" src="{{$dao->picture}}" id="demo1">
                        <input type="hidden" value="{{$dao->picture}}" name="picture">
                    @else
                        <div style="padding-top: 40px;">
                            <i class="layui-icon" style="margin-top: 60px;"></i>
                            <p>点击上传banner图</p>
                        </div>
                    @endif
                </div>
            </div>
        </div>
    </div>
</div>
<div class="layui-form-item">
    <div class="layui-input-block">
        <button type="submit" class="layui-btn" lay-submit="" lay-filter="postForm">确 认</button>
        <a  class="layui-btn" href="javascript:history.go(-1)" id="close" >返 回</a>
    </div>
</div>